package com.abel.demo.services.impl;/**
 * Created by abel.lin on 2017/2/7.
 */

import com.abel.demo.dao.BaseDao;
import com.abel.demo.services.BaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * @author: Abel.lin
 * @date: 2018/7/11 18:45
 * @description: 
 * @return: 
 */
public class BaseServiceImpl<M extends BaseDao<T,C>, T, C> implements BaseService<T,C> {

    protected final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    public M baseMapper;

    public int countByExample(C example) {
        return baseMapper.countByExample(example);
    }


    public int deleteByExample(C example) {
        return baseMapper.deleteByExample(example);
    }

    public int deleteByPrimaryKey(String id) {
        return baseMapper.deleteByPrimaryKey(id);
    }

    public int insert(T record) {
        return baseMapper.insert(record);
    }

    public int insertSelective(T record) {
        return baseMapper.insertSelective(record);
    }

    public int updateByExampleSelective(T record, C example) {
        return baseMapper.updateByExampleSelective(record,example);
    }

    public int updateByExample(T record, C example) {
        return baseMapper.updateByExample(record,example);
    }

    public int updateByPrimaryKeySelective(T record) {
        return baseMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(T record) {
        return baseMapper.updateByPrimaryKey(record);
    }

    public List<T> selectByExample(C example) {

        return baseMapper.selectByExample(example);
    }

    public T selectByPrimaryKey(String id) {
        return baseMapper.selectByPrimaryKey(id);
    }
    
}
